package com.example.service.impl;

import com.example.domain.Report;
import com.example.dao.ReportMapper;
import com.example.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportServiceImpl implements ReportService {

    @Autowired
    private ReportMapper reportMapper;

    @Override
    public void save(Report report) {
        reportMapper.save(report);
    }

    @Override
    public List<Report> findPendingReports() {
        return reportMapper.findPendingReports();
    }

    @Override
    public void updateStatus(Report report) {
        reportMapper.updateStatus(report);
    }

    @Override
    public List<Report> findAll() {
        return reportMapper.findAll();
    }

    @Override
    public Report findById(Integer id) {
        return reportMapper.findById(id);
    }

    @Override
    public void updateStatus(Integer id, String status) {
        reportMapper.updateStatusById(id, status);
    }
}
